<include file="Public/min-header"/>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <div class="row">
        	<div class="col-xs-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 先到先得列表</h3>
                </div>
                <div class="panel-body">
	                <div class="navbar navbar-default">
	                	<form class="navbar-form form-inline" action="" method="post"> 
				            <div class="form-group pull-right">
					            <a href="{:U('Admin/Freeprizes/freeprizes_info')}" class="btn btn-primary pull-right" data-toggle='tooltip'data-original-title="添加活动" ><i class="fa fa-plus"></i>添加活动</a>
				            </div>		          
			          </form>
	                </div>
                    <div id="ajax_return">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);"></td>
                                    <td class="text-center">活动名称</td>
                                    <td class="text-center">活动时间</td>
                                    <td class="text-center">活动商品</td>
                                    <td class="text-center">活动店铺</td>
                                    <td class="text-center">所需分数</td>
                                    <td class="text-center">兑换比例</td>
                                    <td class="text-center">促销状态</td>
                                    <td class="text-center">结算数据</td>
                                    <td class="text-center">操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                <volist name="lists" id="list">
                                    <tr>
                                        <td class="text-center">
                                            <input type="checkbox" name="selected[]" value="6">
                                        </td>
                                        <td class="text-center">{$list.title}</td>
                                        <td class="text-center">
											{$list.start_time|date='Y-m-d',###}
											-{$list.end_time|date='Y-m-d',###}
										</td>
                                        <td class="text-center">{$list.goods_id}</td>
                                        <td class="text-center">{$list.shop_id}</td>
                                        <td class="text-center">{$list.integral}</td>
                                        <td class="text-center">1:{$list.ratio}</td>
                                        <td class="text-center">{$freeprizess[$list[is_on_sale]]}</td>
                                        <td class="text-center">
											<if condition="$freeprizess['settlement_users_id'] eq 0">
											暂无结算
											<else />
											{$list.settlement_time|date='Y-m-d',###}|{$list.settlement_users_id}
											</if>
										</td>
                                        <td class="text-center">
                                            
                                            <a href="{:U('Admin/Freeprizes/freeprizes_info',array('id'=>$list['id']))}" data-toggle="tooltip" title="" class="btn btn-info" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
                                            
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                    </div>
				 <div class="row">
              	    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$page}</div>		
	              </div>                    
				  </div>
                </div>
            </div>
        </div>        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<script>
$('.send_user').click(function(){
    var url = $(this).attr('data-url');
    layer.open({
        type: 2,
        title: '发放优惠券',
        shadeClose: true,
        shade: 0.5,
        area: ['70%', '85%'],
        content: url, 
    });
});

function delfun(obj){
	if(confirm('确认删除')){		
		$.ajax({
			type : 'post',
			url : $(obj).attr('data-url'),
			dataType : 'json',
			success : function(data){
				if(data){
					$(obj).parent().parent().remove();
				}else{
					layer.alert('删除失败', {icon: 2});  //alert('删除失败');
				}
			}
		})
	}
	return false;
}
</script>
</body>
</html>